package com.wenhao.newfeature.annotation;

import com.sun.org.apache.xpath.internal.functions.FuncFalse;

import java.lang.annotation.*;
import java.lang.reflect.Field;

/**
 * @author Wenhao Tong
 * @create 2021-07-30 14:26
 */

public class StudentCheck {
    public static void main(String[] args) throws IllegalAccessException {
        Student student = new Student();
        Class clazz = student.getClass();
        Field[] declaredFields = clazz.getDeclaredFields();
        for (Field field : declaredFields) {
            field.setAccessible(true);
            myValidate annotation = field.getAnnotation(myValidate.class);
            if (annotation != null) {
                String o = (String) field.get(student);
                if (o == null) {
                }
            }
        }
    }
}
